/*
 * ui.c
 *
 *  Created on: May 10, 2024
 *      Author: 20522
 */
#include"ui.h"
#include"main.h"





void lv_example_get_started_1(void)
{


	   //  UI设计
	  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	lv_obj_t * label1 = lv_label_create(lv_screen_active());
	    lv_label_set_long_mode(label1, LV_LABEL_LONG_WRAP);     /*Break the long lines*/
	    lv_label_set_text(label1, "Recolor is supported for v9 now.");
	    lv_obj_set_width(label1, 150);  /*Set smaller width to make the lines wrap*/
	    lv_obj_set_style_text_align(label1, LV_TEXT_ALIGN_CENTER, 0);
	    lv_obj_align(label1, LV_ALIGN_CENTER, 0, -40);

	    lv_obj_t * label2 = lv_label_create(lv_screen_active());
	    lv_label_set_long_mode(label2, LV_LABEL_LONG_SCROLL_CIRCULAR);     /*Circular scroll*/
	    lv_obj_set_width(label2, 150);
	    lv_label_set_text(label2, "It is a circularly scrolling text. ");
	    lv_obj_align(label2, LV_ALIGN_CENTER, 0, 10);


	    lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0x1E90FF), LV_PART_MAIN);//设置字体颜色


	    static lv_style_t style;
	        lv_style_init(&style);

	        lv_style_set_radius(&style, 3);
	        lv_style_set_bg_opa(&style, LV_OPA_COVER);
	        lv_style_set_bg_color(&style, lv_palette_lighten(LV_PALETTE_GREY, 2));
	        lv_style_set_border_width(&style, 1);
	        lv_style_set_border_color(&style, lv_palette_main(LV_PALETTE_BLUE));
	        lv_style_set_pad_all(&style, 5);

	        lv_style_set_text_color(&style, lv_palette_main(LV_PALETTE_BLUE));
	        lv_style_set_text_letter_space(&style, 3);
	        lv_style_set_text_line_space(&style, 3);
	        lv_style_set_text_decor(&style, LV_TEXT_DECOR_UNDERLINE);

	        /*Create an object with the new style*/
	        lv_obj_t * obj = lv_label_create(lv_screen_active());
	        lv_obj_add_style(obj, &style, 0);
	        lv_label_set_text(obj, "Hello!" );


	        //lv_obj_center(obj);
            lv_obj_set_pos(obj, 0, 0);










	    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	      /* 创建group 后面将控件绑定到组即绑定到输入设备 */
	      //lv_group_t * group = lv_group_create();
	      //lv_indev_set_group(NULL, group);


	      //lv_group_add_obj(group,slider);



}





